﻿@model NetPageCommon.Notice;
@{
	//ViewData["Title"] = "Index";

}

<h1>Notice</h1>

<script>
	



    async function btnUpdate()
    {
        const form = document.querySelector('form');

        const data = new FormData(form);

        const response = await  fetch('/Notice/Update',
        {
            method:'POST',
              // headers: {
              //    'Content-Type': 'application/json;charset=utf-8'
              //   },
                    body: data

          });

          const json = await response.json();

          console.log("json 的结果");
          console.log(json);
          if(json.status==200)
          {
              alert(json.message);
          }
          else
          {
              alert("添加失败");
          }


    }


</script>


<figure class="figure">
	<img src="/image/xiangrikui.jpg" style="height:200px;" class="figure-img img-fluid rounded" alt="...">
	<figcaption class="figure-caption">A caption for the above image图片说明.</figcaption>
</figure>


<form>

    <table style="width:96%;">
        <tbody>
            <tr>
                <th width="80">id</th>
                <td>自动生成</td>
            </tr>
            <tr>
                <th>title</th>
                <td><input class="input-group" type="text" id="title" name="title" value="@Model.title" /></td>
            </tr>
            <tr>
                <th>content</th>
                <td>
                    <textarea id="content" name="content" rows="10" style="width:100%;">@Model.content</textarea>
                    </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <input class="input-group" type="hidden" id="Id" name="Id" value="@Model.Id" />
                    <input type="button" class="btn btn-danger" value="保存修改" onclick="btnUpdate()" />
                    
                </td>
            </tr>
        </tbody>
    </table>


</form>

